From: Giovanni Campagna Date: Thu, 29 Mar 2012 16:51:03 +0000 (+0200) Subject: NetworkMenu: fix crash when NetworkManger restarts X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6685 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b6aab53d10d1db4808fd7cdaf248a91344a2d36a;p=gnome-shell.git NetworkMenu: fix crash when NetworkManger restarts nm_active_connection_get_devices() has a (questionable) special case for the no devices case (which happens if the DBus object is destroyed because NM went down): it returns null instead of an empty array. Handle that instead of crashing. https://bugzilla.gnome.org/show_bug.cgi?id=673043 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 5c6babee8..f7d2258cf 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1844,7 +1844,7 @@ const NMApplet = new Lang.Class({ if (a._type != NetworkManager.SETTING_VPN_SETTING_NAME) { // find a good device to be considered primary a._primaryDevice = null; - let devices = a.get_devices(); + let devices = a.get_devices() || []; for (let j = 0; j < devices.length; j++) { let d = devices[j]; if (d._delegate) {